<template>
  <h1>{{ msg }}</h1>
  <button @click="count++">count is: {{ count }}</button>
  <p>Edit <code>components/HelloWorld.vue</code> to test hot module replacement.</p>
  <div>
      <button @click="show('a')">A页面</button>
      <button @click="show('b')">B页面</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data() {
    return {
      count: 0
    }
  },
  methods:{
    show(index){
      if(index == 'a') {
        this.$router.push('/a')
      }
      if(index == 'b') {
        this.$router.push('/b')
      }
    }
  }
}
</script>
